<template>
	<view class="warp">
		<view  v-if="!auditShow">
			<other></other>
		</view>
		<view class="name_info" v-if="auditShow">
			<view class="name_title">
				<view class="linne">
					
				</view>
				<view class="name_title_cont">
					姓名信息
				</view>
			</view>
			<view class="name_cont">
				<view class="nc_title">
					姓名:
				</view>
				<view class="nc_cont"  v-if="pform.firstname && pform.lastname">
					{{pform.firstname}}{{pform.lastname}}
				</view>
			</view>
		</view>
		<view class="name_num" v-if="nameinfo.scores && auditShow">
			<view class="name_title">
				<view class="linne">
					
				</view>
				<view class="name_title_cont">
					名字打分测试
				</view>
			</view>
			<view class="num_info">
				<view class="num_info_title">
					您姓名五格数理评分
				</view>
				<view class="num_cont" v-if="nameinfo.scores">
					<span>{{nameinfo.scores}}</span>
					<!-- <span>分</span> -->
				</view>
			</view>
		</view>
		<!-- 五格 -->
		<view class="fiveinfo" v-if="nameinfo && auditShow">
			<view class="five_title">
				<view class="ft_item">
					数理
				</view>
				<!-- <view class="ft_item">
					五行
				</view> -->
				<!-- <view class="ft_item">
					得分
				</view> -->
				<view class="ft_item">
					凶吉
				</view>
				<view class="ft_item">
					详情
				</view>
			</view>
			<view class="tian">
				<view class="b_item b_item_title">
					<view class="tags">
						天格
					</view>
					<view class="t_num" v-if="nameinfo.tiangeSort">
						{{nameinfo.tiangeSort}}
					</view>
				</view>
				<!-- <view class="b_item">
					金
				</view> -->
				<!-- <view class="b_item" v-if="nameinfo.tiangeMark">
					<span>{{nameinfo.tiangeMark}}</span>
					 
				</view> -->
				<view class="b_item" v-if="nameinfo.tianGeLevel">
					{{nameinfo.tianGeLevel}}
				</view>
				<view class="b_item">
					<view class="ge_info" @click="toinfo">
						查看详情
					</view>
				</view>
				 
			</view>
			<view class="ren">
				<view class="b_item b_item_title">
					<view class="tags">
						人格
					</view>
					<view class="t_num" v-if="nameinfo.personalityScore">
						{{nameinfo.personalityScore}}
					</view>
				</view>
				<!-- <view class="b_item">
					金
				</view> -->
				<!-- <view class="b_item" v-if="nameinfo.personalityMark">
					<span>{{nameinfo.personalityMark}}</span>
					 
				</view> -->
				<view class="b_item" v-if="nameinfo.personalityLevel">
				  {{nameinfo.personalityLevel}}
				</view>
				<view class="b_item">
					<view class="ge_info" @click="toinfo">
						查看详情
					</view>
				</view>
			</view>
			<view class="di">
				<view class="b_item b_item_title" >
					<view class="tags">
						地格
					</view>
					<view class="t_num" v-if="nameinfo.digeSort">
						{{nameinfo.digeSort}}
					</view>
				</view>
				<!-- <view class="b_item">
					金
				</view> -->
				<!-- <view class="b_item" v-if="nameinfo.digeMark">
					<span>{{nameinfo.digeMark}}</span>
				</view> -->
				<view class="b_item" v-if="nameinfo.diGeLevel">
					{{nameinfo.diGeLevel}}
				</view>
				<view class="b_item">
					<view class="ge_info" @click="toinfo">
						查看详情
					</view>
				</view>
			</view>
			<view class="wai">
				<view class="b_item b_item_title">
					<view class="tags ">
						外格
					</view>
					<view class="t_num" v-if="nameinfo.waigeSort">
						{{nameinfo.waigeSort}}
					</view>
				</view>
				<!-- <view class="b_item">
					金
				</view> -->
				<!-- <view class="b_item" v-if="nameinfo.waigeMark">
					<span>{{nameinfo.waigeMark}}</span>
				</view> -->
				<view class="b_item" v-if="nameinfo.waiGeLevel">
					{{nameinfo.waiGeLevel}}
				</view>
				<view class="b_item">
					<view class="ge_info" @click="toinfo">
						查看详情
					</view>
				</view>
			</view>
			<view class="all">
				<view class="b_item b_item_title">
					<view class="tags">
						总格
					</view>
					<view class="t_num" v-if="nameinfo.strokeTotalNums">
						{{nameinfo.strokeTotalNums}}
					</view>
				</view>
			<!-- 	<view class="b_item">
					金
				</view> -->
			<!-- 	<view class="b_item" v-if="nameinfo.scores">
					<span>{{nameinfo.scores}}</span>
				</view> -->
				<view class="b_item" v-if="nameinfo.wuGeLevel">
					{{nameinfo.wuGeLevel}}
				</view>
				<view class="b_item" >
					<view  class="ge_info" @click="toinfo">
						查看详情
					</view>
				</view>
			</view>
		</view>
		<view class="allinfo">
			<view @click="toinfo" class="all_button">
				综合详情解释
			</view>
		</view>
	</view>
</template>

<script>
	import other from '@/components/other/index.vue'
	export default{
		components:{other},
		data(){
			return{
				auditShow:false,
				pform:{},//传参数据
				nameinfo:{},//打分数据
				
			}
		},
		onLoad(options) {
			if ('params' in options) {
				
			      let obj = JSON.parse(decodeURIComponent(options.params));
				  console.log(obj);
				this.pform=obj
			 }this.getnamevalinfo()
		},
		onShow() {
			this.getAudit()
		},
		methods:{
			//获取微信审核开关
			getAudit(){
			    let param = {};
				param.url='v3/system/front/configuration/1'
				this.$request(param).then(res=>{
					console.log(res);
					this.auditShow=res.data.auditSwitch
					if(this.auditShow){
						uni.setNavigationBarTitle({
							title:'姓名分析'
						})
					}
				})
			},
			// 获取测评数据
			getnamevalinfo(){
				this.$request({
					url:'v3/name/grade/front/measuring/score',
					method:'POST',
					header:{
						'Content-Type': 'application/json;charset=utf-8',
					},
					data:{surname:this.pform.firstname,name:this.pform.lastname}
				}).then(res=>{
					this.nameinfo=res.data
					// console.log(res);
				})
			},
			toinfo(){
				uni.navigateTo({
					url:"/pages/moreModule/nameevaluation/namewugeinfo/namewugeinfo?surname="+this.pform.firstname+"&name="+this.pform.lastname
				})
			}
			
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #fff;
		// padding: 20rpx;
	}
	.warp{
		overflow: hidden;
		padding: 20rpx;
		.name_info{
			margin-top: 20rpx;
			// padding: 20rpx;
			border-bottom: 2rpx solid #cecece;
			.name_title{
				display: flex;
				padding-bottom: 10rpx;
				border-bottom: 2rpx solid #cecece;
				.linne{
					width: 8rpx;
					height: 60rpx;
					background-color: #88b7ff;
					margin-right: 30rpx;
				}
				.name_title_cont{
					font-size: 30rpx;
					font-weight: 600;
					height: 60rpx;
					line-height: 60rpx;
					
					
				}
				
				}
				.name_cont{
					height: 120rpx;
					line-height: 100rpx;
					display: flex;
					padding: 20rpx 10rpx;
					font-size: 28rpx;
					font-weight: 550;
				padding: 0 30%;
					.nc_title{
						 
						font-size: 30rpx;
						
						color: #88b7ff;
						margin-right: 20rpx;
					}
					.nc_cont{
					 font-size: 34rpx;
					}
				}
		}
		.name_num{
			margin-top: 40rpx;
			// padding: 20rpx;
			border-bottom: 2rpx solid #cecece;
			.name_title{
				display: flex;
				padding-bottom: 10rpx;
				border-bottom: 2rpx solid #cecece;
				.linne{
					width: 8rpx;
					height: 60rpx;
					background-color: #88b7ff;
					margin-right: 30rpx;
				}
				.name_title_cont{
					font-size: 30rpx;
					font-weight: 600;
					height: 60rpx;
					line-height: 60rpx;
					
					
				}
		}
	.num_info{
		padding: 0 0 10rpx 0;
		.num_info_title{
			text-align: center;
			padding: 18rpx 10rpx;
			font-size: 28rpx;
			font-weight: 550;
			color: #749dda;
		}
		.num_cont{
			padding: 10rpx;
			text-align: center;
			font-size: 44rpx;
			color: #88b7ff;
		}
	}
		
	
		}
		// 五格
		.fiveinfo{
			margin-top: 20rpx;
			padding: 10rpx;
			font-size: 28rpx;
			.five_title{
				background-color: #88b7ff;
				display: flex;
				justify-content: space-between;
				color: #fff;
				padding: 10rpx 56rpx 10rpx 30rpx;
			}
			.tian,.ren,.di,.wai,.all{
				border-bottom: 2rpx solid #f4af8f;
				color: #bd8962;
				display: flex;
				justify-content: space-between;
				padding: 10rpx 0rpx 10rpx 0rpx;
				.b_item_title{
					display: flex;
					align-items: center;
					.tags{
						background-color: #88b7ff;
						color: #fff;
						padding: 6rpx 10rpx;
						border-radius: 8rpx;
					
					}
					.t_num{
						width: 40rpx;
						padding-left: 10rpx;
					}
				}
				.b_item{
					padding: 12rpx 0;
					
					.ge_info{
						padding: 6rpx 15rpx;
						background-color: #88b7ff;
						color: #fff;
						border-radius: 6rpx;
					}
				}
			}
			
		}
		.allinfo{
			margin-top: 40rpx;
			width: 100%;
			margin-left: 30%;
           			.all_button{
						text-align: center;
				width:40%;
				padding: 20rpx 20rpx !important;
				background-color: #88b7ff;
				color: #fff;
				border-radius: 36rpx;
			}
		}
	}
</style>